import Vue from 'vue'
import Router from 'vue-router'
import Vis from '@/components/Vis'
import Bar from '@/components/barChart/BasicBarChart/Bar'
import StackBar from '@/components/barChart/StackBarChart/StackBar'
import MultiBar from '@/components/barChart/MultiBarChart/MultiBar'
import HorizontalBar from '@/components/barChart/horizontalBarChart/HorizontalBar'
import Line from '@/components/lineChart/BasicLineChart/Line'
import AreaLine from '@/components/lineChart/AreaLineChart/AreaLine'
import StackLine from '@/components/lineChart/StackLineChart/StackLine'
import Pie from '@/components/PieChart/BasicPie/Pie'
import Rose from '@/components/PieChart/RoseChart/Rose'
import Gauge from '@/components/GaugeChart/BasicGauge/Gauge'
import ResponsiveGauge from '@/components/GaugeChart/ResponsiveGauge/ResponsiveGauge'
import GeoMap from '@/components/geoMap/DotMap/GeoMap'
import AreaMap from '@/components/geoMap/AreaMap/AreaMap'
import GraduatedGauge from '@/components/GaugeChart/GraduatedGauge/GraduatedGauge'
import Scatter from '@/components/scatter/basicScatter/Scatter'
import Bubble from '@/components/scatter/bubbleChart/Bubble'
import MultiSignScatter from '@/components/scatter/MultiSignScatter/MultiSignScatter'
import RingRadar from '@/components/RadarChart/RingRadar/Radar'
import Radar from '@/components/RadarChart/Radar/Radar'
import Tree from '@/components/Tree/BasicTree/Tree'
import RadiusTree from '@/components/Tree/RadiusTree/RadiusTree'
import TreeMap from '@/components/Tree/TreeMap/TreeMap'
import Parallel from '@/components/ParallelChart/Parallel'
import SunBurst from '@/components/sunBurst/SunBurst'
import Sankey from '@/components/Sankey/Sankey'
import Chord from '@/components/ChordChart/Chord'
import Calendar from '@/components/CalendarChart/Calendar'
import Force from '@/components/Force/Force'

const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/vis'
    },
    {
      path: '/vis',
      name: 'Vis',
      component: Vis,
      children: [
        {
          path: '/barchart',
          component: Bar
        },
        {
          path: '/stackbar',
          component: StackBar
        },
        {
          path: '/multibar',
          component: MultiBar
        },
        {
          path: '/horizontalbar',
          component: HorizontalBar
        },
        {
          path: '/linechart',
          component: Line
        },
        {
          path: '/arealinechart',
          component: AreaLine
        },
        {
          path: '/stackline',
          component: StackLine
        },
        {
          path: '/piechart',
          component: Pie
        },
        {
          path: '/rose',
          component: Rose
        },
        {
          path: '/gaugechart',
          component: Gauge
        },
        {
          path: '/responsivegauge',
          component: ResponsiveGauge
        },
        {
          path: '/graduatedgauge',
          component: GraduatedGauge
        },
        {
          path: '/geomap',
          component: GeoMap
        },
        {
          path: '/areamap',
          component: AreaMap
        },
        {
          path: '/scatter',
          component: Scatter
        },
        {
          path: '/bubble',
          component: Bubble
        },
        {
          path: '/multisignscatter',
          component: MultiSignScatter
        },
        {
          path: '/radarchart',
          component: RingRadar
        },
        {
          path: '/radar',
          component: Radar
        },
        {
          path: '/tree',
          component: Tree
        },
        {
          path: '/radiustree',
          component: RadiusTree
        },
        {
          path: '/treemap',
          component: TreeMap
        },
        {
          path: '/parallel',
          component: Parallel
        },
        {
          path: '/sunburst',
          component: SunBurst
        },
        {
          path: '/sankey',
          component: Sankey
        },
        {
          path: '/chord',
          component: Chord
        },
        {
          path: '/calendar',
          component: Calendar
        },
        {
          path: '/force',
          component: Force
        }
      ]
    }
  ]
})
